﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using DataLib.Accounts.Bus;

namespace Ewts.Project
{
    public partial class CustomerByProject : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string username = "";
                if (Session["UserInfo"] != null)
                {
                    User curUser = new DataLib.Accounts.Bus.User();
                    curUser = (User)Session["UserInfo"];
                    username = curUser.UserName;
                }
                else
                {
                    Response.Redirect("/accounts/login.aspx");
                }
                bindData(username);
            }
        }

        /// <summary>
        /// 客户列表
        /// </summary>
        /// <param name="username"></param>
        public void bindData(string username)
        {
            DataTable dt = new DataTable();
            dt = new DataLib.BLL.ProjectsRelation().getProjectByUserName(username, 1);
            rept.DataSource = dt;
            rept.DataBind();

        }
    }
}